#ifndef CONTROLSERVICE_H
#define CONTROLSERVICE_H

#include <QObject>
#include <QQmlApplicationEngine>
#include <QCoreApplication>
#include "beans/dealpicturethread.h"

class MsgControl;

class ControlService : public QObject
{
    Q_OBJECT

public:
    ControlService(QObject* parent = nullptr);
    ~ControlService();

private:
    void __initBeans();                 //初始化注入实体类
    void __initQml(QObject *parent);    //初始化qml引擎
    void __initRegistBean();            //初始化注入函数 完成beans到qml的注册
    void __initSlots();
    void setSoftLanguage(const QString& type);

private:
    std::shared_ptr<QQmlApplicationEngine> m_qmlEngine;
    std::shared_ptr<MsgControl> m_MsgControl;
    std::shared_ptr<DealSmallPictureThread> m_SmallPicThread;
    std::shared_ptr<DealBigPictureThread> m_BigPicThread;
    const QCoreApplication* m_App = nullptr;

signals:

public slots:
    void doChangeLanguage(const QString& type); //切换语言
};

#endif // CONTROLSERVICE_H
